<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
<!-- 添加对应依赖 -->
  <div id="root"></div>
  <div id="app"></div>
  <script crossorigin src="https://unpkg.com/react@17/umd/react.development.js"></script>
  <script crossorigin src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"></script>
  <script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
  
  <script type="text/babel">
    // jsx语法，默认浏览器不识别，由babel识别
    // react/react-dom/babel(编译器/转化器)
    // cdn引用，npm下载引用
    // React18之前：ReactDOM.render
    // ReactDOM.render(<h2>Hello World</h2>,document.querySelector("#root"))


    // React18之后
    const root = ReactDOM.createRoot(document.querySelector("#root"))
    root.render(<h2>helloworld</h2>)
    const app = ReactDOM.createRoot(document.querySelector("#app"))
    app.render(<h2>你好李银河</h2>)
  </script>
</body>
</html>